﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

namespace YArchitech.Revit
{
	public class HYDefineModelCurveFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			bool result = false;
			if (elem is ModelCurve)
			{
				ModelCurve modelCurve = elem as ModelCurve;
				if (modelCurve.GroupId == null || modelCurve.GroupId.IntegerValue < 0)
				{
					result = true;
				}
			}
			return result;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			return false;
		}
	}
}
